<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
<meta name="keywords" content="2017台州国际马拉松官网,台州马拉松，全程马拉松，" />
<meta name="description" content="2017台州国际马拉松官网-和合山海，穿越未来。2017台州国际马拉松为专业跑友提供线上报名与支付,跑友可查询参赛号及下载成绩证书,并可随时了解2017台州国际马拉松的实时资讯。" />
<meta name="author" content="">
<title>2017台州国际马拉松赛</title>
<link rel="stylesheet" href="<?php echo STATICSPATH;?>css/bootstrap.css">
<link rel="stylesheet" href="<?php echo STATICSPATH;?>css/fontawesome/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo STATICSPATH;?>css/swiper.css">
<link rel="stylesheet" href="<?php echo STATICSPATH;?>css/style.css">

<script type="text/javascript" src="<?php echo STATICSPATH;?>js/jquery.min.js"></script>



<link href="<?php echo STATICSPATH;?>css/mui.min.css" rel="stylesheet" />
<script src="<?php echo STATICSPATH;?>js/mui.min.js"></script>
<script type="text/javascript" src="<?php echo STATICSPATH;?>js/jSignature.min.js"></script>


</head>

<body style="background-color:#fff;">

<form id="signform">
<div align="center" class="quernhan" ><img src="<?php echo $pic_url;?>" alt=""/>
	<!--
	<p class="haoma"><?php if(!empty($order_info['match_code']) && date('YmdHis')>'20170908100000'){ echo $order_info['match_code'];}else{echo '待分配';}?></p>
	<p class="name"><?php echo $order_info['realname'];?></p>
	<p class="zhangjian"><?php echo $order_info['id_number'];?></p>
	<p class="yifu"><?php echo $order_info['cloth_size'];?></p>
	<p class="qianming"></p>
	-->


	<!--签div名区域div from taishan  位置css调整-->
	<div class="nc-reg">
		<div id="signature" style="height: 100%;border:1px dashed #000;" ></div>
	    <div class="tishi">请签名确认</div>
		<div id="pic" />
			<p id="base" style="width:100%;height: 100%;"></p>
		</div>
	</div>
	<!--签名div区域 from taishan  位置css调整-->




</div>



<!--需要有一个提交按钮  位置css调整-->
<div class="form-group lingwu">
    <div class="btn-mc-center ">
    	<a href="javascript:void(0);" id="btn-red" class="btn btn-default">提交</a>
        	<input id="clear" type="button" value="重签"  class="chongqian"  >
    </div>
</div>
<!--需要有一个提交按钮  位置css调整-->




<input type="hidden" name="order_id" id="order_id" value="<?php echo $order_id;?>">
<input type="hidden" name="identity" id="identity" value="<?php echo $order_info['id_number'];?>">


<script type="text/javascript" charset="utf-8">
	mui.plusReady(function() {
		plus.screen.lockOrientation('landscape-secondary');
	});
	$(document).ready(function() {
		$("#signature").jSignature({color:"#000",lineWidth:2,height:'100%',width:'100%','decor-color':'#ffffff'});  //设置签名区宽高，也是最终生成图片的宽高。可以写百分数，也可以写整数。经试验，写整数有时对鼠标不敏感。from taishan
	});
	document.getElementById("clear").addEventListener('tap', function() {
		$("#signature").jSignature("reset");
		$("#pic")[0].innerHTML = '';
	});
</script>

<script>
 	document.getElementById("btn-red").addEventListener('tap', function() {
		var datapair = $("#signature").jSignature("getData", "image");
		var identity = $("#identity").val();
		var order_id = $("#order_id").val();
		//alert(identity);return;
		//console.log(datapair);return;
		//var i = new Image();
		//i.src = "data:" + datapair[0] + "," + datapair[1];
		//$(i).appendTo($("#pic"));
		var sign_pic="data:" + datapair[0] + "," + datapair[1];
		//alert(datapair[0]);return;
		$.post("/service/savesign",$("#signform").serialize()+'&sign_pic='+encodeURIComponent(sign_pic)+'&identity='+encodeURIComponent(identity) , function(result){
			var ret = $.parseJSON(result); 
			if(ret.success=='success'){
            	 location.href="/baoming/ling_wu_showsign/identity/"+identity+"/order_id/"+order_id;
            }
            else{
            	alert(ret.success);
            	//alert(ret.errorMessage);
            }
			
			//window.history.go(-1);
		});
	});
</script>




</form>
</body>
</html>
